

import java.util.Scanner;

public class example024 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个整数：");
        int num = scanner.nextInt();
        if (num < 100 || num > 999) {
            System.out.println(num + " 不是水仙花数");
        } else {
            int hundred = num / 100;
            int ten = (num % 100) / 10;
            int one = num % 10;
            int sum = (int) (Math.pow(hundred, 3) + Math.pow(ten, 3) + Math.pow(one, 3));
            if (sum == num) {
                System.out.println(num + " 是水仙花数");
            } else {
                System.out.println(num + " 不是水仙花数");
            }
        }
    }
}

